Juergen Gross [Thu, 28 Oct 2010 11:22:09 +0000 (12:22 +0100)]
avoid numa placement of cpus with active cpupools
When using cpupools don't pin vcpus to numa nodes as this might
conflict with the cpupool definition.
numa placement should be handled by cpupool configuration instead.
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 28 Oct 2010 11:19:43 +0000 (12:19 +0100)]
libxl: Fix migration of HVM guests
In the default "QemuDeviceModelRecord"-style HVM tail of the migration
protocol the size of the qemu save record is unknown at the receiver
and therefore it must read until EOF. This is not compatible with the
xl migration protocol which contains a post-migration handshake and
therefore cannot close the socket on the sending end.
What is required is an explicit length field for the save record,
which the "RemusDeviceModelState"-style HVM tail includes.
Rather than overload the "RemusDeviceModelState" name for a non-Remus
use case (on off chance that they need to diverge for some reason in
the future) introduce a third style called "DeviceModelRecord0002"
which is identical to current "RemusDeviceModelState"-style.
Hopefully the inclusion of a number here will allow easier extension
in the future without needing to come up with increasingly less
helpful names!
Also propagate errors from xc_domain_save and
libxl__domain_suspend_common to callers.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 28 Oct 2010 11:16:48 +0000 (12:16 +0100)]
xl: support -w (wait) option in xl shutdown
improves compatibility with xm.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Patrick Colp [Thu, 28 Oct 2010 11:15:41 +0000 (12:15 +0100)]
tools: caml-stubdom: fix "red zone" bug
According to the AMD64 ABI, the 128-byte area below %rsp is reserved
for scratch space and should not be used by signal, interrupt, or
exception handlers. However, Mini-OS does not adhere to this
interface. As a result, the -mno-red-zone flag must be provided to gcc
in order to force code to be compiled without this assumption. In the
case of the c-stubdom or the ioemu stubdom, Makefile configuration and
flags are inherited from Xen, which includes this flag. However, in
the case of the ocaml stubdom, since an independent ocaml version is
pulled and compiled, with its own make system in place, this flag is
not present.
As a default optimisation (no optimisation flags specified), gcc
generates function header code that uses mov instead of push (to save
a few instructions). However, with the 128-byte scratch space
assumption in place, registers are moved onto the stack *before* %rsp
is updated. This results in cases where when a function is being
called, *after* the first mov <foo>, <offset>(%rsp) but *before* the
%rsp update, sub <bar>, %rsp, if an interrupt is fired, then the stack
will be clobbered (as Mini-OS uses the application stack for its
stack, pushing registers onto the stack on entry and popping them off
on exit).
This patch fixes this issue by passing the -mno-red-zone flag to the
ocaml configure script in the stubdom Makefile.
Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 28 Oct 2010 11:05:45 +0000 (12:05 +0100)]
libxl: Fix format string abuses / vulnerabilities
There are a few places where libxl__xs_write is passed a variable
value to write to xenstore, but the semantics are that the first char*
is a format string. So use "%s".
This fixes the following errors reported by some newer compilers:
libxl.c: In function "libxl_create_cpupool":
libxl.c:3981: error: format not a string literal and no format arguments
libxl.c:3983: error: format not a string literal and no format arguments
libxl.c: In function "libxl_cpupool_movedomain":
libxl.c:4095: error: format not a string literal and no format arguments
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Gianni Tedesco [Thu, 28 Oct 2010 11:02:22 +0000 (12:02 +0100)]
libxl: fix dom0 minimum memory threshold check
libxl_set_memory_target tries to set the memory target for a given
domain to new_target_memkb. The function includes a check to make sure
that dom0's memory is not reduced below a minimal threshold ie.
LIBXL_MIN_DOM0_MEM. However, this check is performed before the
new_target_memkb variable is properly initialised - when the value is
always zero. This means that the check always fails. Fix this by moving
the test to happen after the proper initialisation of new_target_memkb.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Gianni Tedesco [Thu, 28 Oct 2010 10:47:26 +0000 (11:47 +0100)]
gdbsx: Makefiles: correctly generate dependencies
gdbsx hacks CFLAGS to remove optimisations for easier debugging, however
this breaks dep generation due to an early evaluation of CFLAGS and
leaves stale files called "..d" after a make clean. We could possibly
fix this by separating dep generation from the rest of CFLAGS but it
seems a little invasive. The gdbsx hackers can do their own thing during
development and testing anyway...
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Gianni Tedesco [Thu, 28 Oct 2010 10:46:20 +0000 (11:46 +0100)]
ocaml: Makefile: delete dependency files during make clean
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Gianni Tedesco [Thu, 28 Oct 2010 10:45:54 +0000 (11:45 +0100)]
tools: Makefile: delete qemu during make distclean
The top-level makefile claims this to be the expected behaviour so make
it so.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Gianni Tedesco [Thu, 28 Oct 2010 10:45:09 +0000 (11:45 +0100)]
libxl: Makefile: delete temporary files during make clean
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Gianni Tedesco [Thu, 28 Oct 2010 10:44:17 +0000 (11:44 +0100)]
blktap2: Makefiles: delete symlinks and deps during make clean
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Miroslav Rezanina [Thu, 28 Oct 2010 10:40:32 +0000 (11:40 +0100)]
Do not wait for memory teardown when live migrate
When trying to live migrate guest with great memory (e.g. 20 GB),
there's delay caused by destroying source copy of domain. To speed up
this process we can close socket before starting guest destroy, as
source guest is not running anymore.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Wed, 27 Oct 2010 11:24:28 +0000 (12:24 +0100)]
libxc: fix xc_version by handling all known command types.
xend was crashing since 22289:
ca4a781c8ae8 due to missing handling of
XENVER_commandline.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Ian Jackson [Tue, 26 Oct 2010 11:22:52 +0000 (12:22 +0100)]
Merge
Tim Deegan [Tue, 26 Oct 2010 10:56:31 +0000 (11:56 +0100)]
"kdd" Windows debugger stub.
kdd runs in dom0, attaches to a domain and speaks the Windows kd serial
protocol over a TCP connection (which should go to kd or windbg, e.g.
by having another VM with its virtual COM1 set up as a TCP listener).
It doesn't do breakpoints &c yet, and windbg can get quite confused
since the kernel debugger's not actually running, but it's good enough
to extract backtraces from wedged VMs.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Ian Campbell [Mon, 25 Oct 2010 17:15:28 +0000 (18:15 +0100)]
libxc: correct handling of switch_qemu_logdirty callback return value
The callback return convention follows xc_domain_save and therefore
returns 0 on success and >0 on error, correct the check accordingly.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Sun, 24 Oct 2010 12:18:26 +0000 (13:18 +0100)]
hvmloader: reduce iasl verbosity
I don't think anyone really needs iasl's banner displayed during the
build process.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Sun, 24 Oct 2010 12:17:42 +0000 (13:17 +0100)]
ia64: fix build in grant table and tmem code
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Sun, 24 Oct 2010 12:17:07 +0000 (13:17 +0100)]
x86: enable support for {rd,wr}{fs,gs}base instructions
... so that once in a while Xen knows of a new CPU feature before
Linux starts making use of it.
While (obviously) I wasn't able to test this, it seemed strait forward
enough to enable anyway.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Sun, 24 Oct 2010 12:15:48 +0000 (13:15 +0100)]
x86: delete not really used ioapic_renumber_irq variable
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Sun, 24 Oct 2010 12:15:06 +0000 (13:15 +0100)]
x86/kexec: fix very old regression and make compatible with modern Linux
c/s 13829 lost the (32-bit only) cpu_has_pae argument passed to the
primary kernel's stub (in the 32-bit Xen case only), and Linux
2.6.27/.30 (32-/64-bit) introduced a new argument (for KEXEC_JUMP)
which for now simply gets passed a hardcoded value.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Sun, 24 Oct 2010 12:13:04 +0000 (13:13 +0100)]
Allow max_pages to be set to less than tot_pages
The memory allocation code sometimes needs to enforce that a guest
that's been told to balloon down isn't going to expand further
(because it's still executing a previous balloon-up operation). That
means being able to set the desired max_pages even before the balloon
driver has brought tot_pages down to the right level.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Sun, 24 Oct 2010 12:09:50 +0000 (13:09 +0100)]
cpupools: Make interface more consistent
The current cpupools code interface is a bit inconsistent. This
patch addresses this by making the interaction for each
vcpu in a pool look like this:
alloc_vdata() -- allocates and sets up vcpu data
insert_vcpu() -- the vcpu is ready to run in this pool
remove_vcpu() -- take the vcpu out of the pool
free_vdata() -- delete allocated vcpu data
(Previously, remove_vcpu and free_vdata were combined into a "destroy
vcpu", and insert_vcpu was only called for idle vcpus.)
This also addresses a bug in credit2 which was caused by a
misunderstanding of the cpupools interface.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: finalise transition to hypercall buffers.
Rename xc_set_xen_guest_handle to set_xen_guest_handle[0] and remove now
unused functions:
- xc_memalign
- lock_pages
- unlock_pages
- hcall_buf_prep
- hcall_buf_release
[0] sed -i -e 's/xc_set_xen_guest_handle/set_xen_guest_handle/g' \
tools/libxc/*.[ch] \
tools/python/xen/lowlevel/xc/xc.c \
tools/python/xen/lowlevel/acm/acm.c \
tools/libxc/ia64/xc_ia64_stubs.c \
tools/security/secpol_tool.c \
tools/misc/xenpm.c
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: do not align/lock buffers which do not need it
On restore:
region_mfn is passed to xc_map_foreign_range and
xc_map_foreign_bulk. In both cases the buffer is accessed from the
ioctl handler in the kernel and not from any hypercall. Therefore
normal copy_{to,from}_user handling in the kernel will cope with any
faulting access.
p2m_batch is passed to xc_domain_memory_populate_physmap which takes
care of bouncing the buffer already.
On save:
pfn_type is passed to xc_map_foreign_bulk which does not need locking
as per region_mfn above.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
secpol: use hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
xenpm: use hypercall buffers.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
python xc: use hypercall buffer interface.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
python acm: use hypercall buffer interface.
I have a suspicion these routines should be using libxc rather than
reimplementing all the hypercalls again, but I don't have the
enthusiasm to fix it.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert ia64 dom0vp interface to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: switch page offlining interfaces to hypercall buffers
There is no need to lock/bounce minfo->pfn_type in init_mem_info since
xc_get_pfn_type_batch() will take care of that for us.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert mmuext op interface over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert memory op interface over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert gnttab interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert tmem interface over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert mca interface over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert hvmop interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert flask interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert physdevop interface over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert schedop interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert evtchn interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert acm interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert watchdog interface over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert sysctl interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert shadow domctl interfaces and save/restore over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert domctl interfaces over to hypercall buffers
(defer save/restore and shadow related interfaces til a later patch)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 22 Oct 2010 14:14:51 +0000 (15:14 +0100)]
libxc: convert xc_version over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Tue, 26 Oct 2010 11:11:37 +0000 (12:11 +0100)]
libxc: infrastructure for hypercall safe data buffers.
(Modified version of this patch, with updated #includes in
xc_hcall_buf.c to fix stubdomain build.)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 26 Oct 2010 11:08:10 +0000 (12:08 +0100)]
minios: add parentheses to mlock/mulock arguments.
Fixes warning/build error with non-trivial arguments.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 21 Oct 2010 17:51:36 +0000 (18:51 +0100)]
QEMU_TAG update
Ian Jackson [Thu, 21 Oct 2010 17:51:26 +0000 (18:51 +0100)]
libxl: add a detailed explanation of the libxl domain memory model
Originally-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Converted to US-ASCII by iwj.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 21 Oct 2010 17:46:32 +0000 (18:46 +0100)]
tools: cleanup domain save switch_qemu_logdirty callback
Move the function into struct save_callbacks with the others and add
the void *closure to the callback arguments.
Add and propagate an error return code from the callback.
Use this in libxl to pass the save context to
libxl__domain_suspend_common_switch_qemu_logdirty allowing us to reuse
the parent's xenstore handle, gc context etc.
Also add an apparently missing libxl__free_all to
libxl__domain_suspend_common.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Juergen Gross [Thu, 21 Oct 2010 17:36:57 +0000 (18:36 +0100)]
tools: cpupools: add example cpupool config file
Adds an example configuration file for xm/xl pool-create
Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Juergen Gross [Thu, 21 Oct 2010 17:36:22 +0000 (18:36 +0100)]
tools: cpupools: xl: commands and library changes
Support of cpu pools in libxl and xl:
library functions
xl cpupool-create
xl cpupool-list
xl cpupool-destroy
xl cpupool-cpu-add
xl cpupool-cpu-remove
xl cpupool-migrate
Renamed all cpu pool related names to *cpupool*
Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Juergen Gross [Thu, 21 Oct 2010 17:35:18 +0000 (18:35 +0100)]
tools: cpupools: Rename cpu-pool commands in xm to cpupool-*
The xm commands pool-* are renamed to cpupool-*
The old pool-* commands are defined as aliases.
Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
--HG--
rename : tools/python/xen/xm/pool-create.py => tools/python/xen/xm/cpupool-create.py
rename : tools/python/xen/xm/pool-new.py => tools/python/xen/xm/cpupool-new.py
rename : tools/python/xen/xm/pool.py => tools/python/xen/xm/cpupool.py
Juergen Gross [Thu, 21 Oct 2010 17:32:56 +0000 (18:32 +0100)]
tools: cpupools: Support arbitrary numbers of physical cpus
To be able to support arbitrary numbers of physical cpus it was necessary to
include the size of cpumaps in the xc-interfaces for cpu pools.
These were:
definition of xc_cpupoolinfo_t
xc_cpupool_getinfo()
xc_cpupool_freeinfo()
xc_cpupool_getinfo() and xc_cpupool_freeinfo() are changed to allocate the
needed buffer and return it.
Signed-off-by: juergen.gross@ts.fujitsu.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 21 Oct 2010 17:14:50 +0000 (18:14 +0100)]
xenstore: add xenstore-watch command line client
# xenstore-watch x | while read w ; do
> echo "watch fired on $w"
> echo "value" $(xenstore-read $w)
> echo
> done
# xenstore-write x/y/z 42
output from while loop:
watch fired on x/t/z
value 42
[ also add line to .hgignore - iwj ]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 21 Oct 2010 17:00:39 +0000 (18:00 +0100)]
xl: fix spelling mistake in xl.conf
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 21 Oct 2010 16:56:51 +0000 (17:56 +0100)]
xenstored: return EINVAL for attempt to watch invalid path
errno is essentially random at this point.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Wed, 20 Oct 2010 16:26:51 +0000 (17:26 +0100)]
x86 hvm: When sending INIT-SIPI IPIs, pause the sending vcpu until the
asynchronous tasklet completes its work.
This is a little bit cleaner than busy-spinning in a retry loop.
Signed-off-by: Keir Fraser <keir@xen.org>
Keir Fraser [Wed, 20 Oct 2010 15:36:32 +0000 (16:36 +0100)]
hvmloader: Properly block on xenstore daemon rather than merely yielding.
Signed-off-by: Keir Fraser <keir@xen.org>
Keir Fraser [Wed, 20 Oct 2010 08:56:36 +0000 (09:56 +0100)]
x86 hvm: Improve test for wait-for-SIPI state of a target VLAPIC.
This fixes a livelock in hvmloader with credit2 scheduler, whereby an
AP can be brought online, do its work, and shut itself down, before
the BSP re-emulates the VLAPIC write that sent the SIPI. BSP then ends
up in an endless re-emulation work where it sees the target vcpu is
down, therefore schedules a tasklet, which does no work because the
vcpu is already initialised. The fix is to check v->is_initialised
rather than VPF_down, before scheduling the tasklet.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Wed, 20 Oct 2010 07:41:58 +0000 (08:41 +0100)]
svm: Re-enable 2MB super paging
Bitwise OR operator has higher precedence than conditional
operator. This patch fixes the incorrect associativity and re-enables
2MB paging for AMD family 10h system.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
Keir Fraser [Wed, 20 Oct 2010 07:40:44 +0000 (08:40 +0100)]
msi: Mask out multi-function flag from PCI_HEADER_TYPE in read_pci_mem_bar()
This leads to an erroneous WARN_ON and possibly other side effects. It
seems to me that even multi-function devices ought to enjoy the
privilege of MSI-X capabilities.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:40:08 +0000 (17:40 +0100)]
libxc: use generic xc_get_pfn_list on ia64
The ia64 specific xc_get_pfn_list doesn't seem any different to the
generic xc_get_pfn_list once the call to xc_ia64_get_pfn_list is
expanded so remove and just use the generic one.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:39:44 +0000 (17:39 +0100)]
libxc: do not lock VCPU context in xc_ia64_pv_recv_vcpu_context
xc_ia64_pv_recv_vcpu_context does not need to lock the ctxt buffer
since it calls xc_ia64_recv_vcpu_context which calls
xc_vcpu_setcontext which takes care of any necessary bouncing.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:38:15 +0000 (17:38 +0100)]
libxc: drop xc_get_max_pages
The function isn't really ia64 specific but since the result isn't
actually used in the only caller and the same info is available via
xc_domain_getinfo simply drop the function.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:37:50 +0000 (17:37 +0100)]
libxc: simplify lock profiling API
Current function has heavily overloaded semantics for the various
arguments. Separate out into more specific functions.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:37:31 +0000 (17:37 +0100)]
libxc: simplify performance counters API
Current function has heavily overloaded semantics for the various
arguments. Separate out into more specific functions.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:36:46 +0000 (17:36 +0100)]
libxc: make do_memory_op's callers responsible for locking indirect buffers
Push responsibility for locking buffers refered to by the memory_op
argument up into the callers (which are now all internal to libxc).
This removes the last of the introspecation from do_memory_op and
generally makes the transistion to hypercall buffers smoother.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:35:59 +0000 (17:35 +0100)]
libxc: make xc_memory_op library private
Now that all XENMEM_* callers go via an op specific function make
xc_memory_op private to libxc (and rename to do_memory_op for
consistency with other private functions).
Also change the interface to take a size parameter so that
do_memory_op knows how much memory to lock for the top-level argument,
removing some of the introspection.
[ Compatibility note: this breaks qemu-xen before
706bc8c588cb ]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:35:35 +0000 (17:35 +0100)]
libxc: remove compatibility macro for xc_domain_memory_populate_physmap
[ Compatibility note: this breaks qemu-xen before
d3c5e73eb3ae ]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Mon, 18 Oct 2010 16:28:02 +0000 (17:28 +0100)]
QEMU_TAG update
Ian Campbell [Mon, 18 Oct 2010 16:17:25 +0000 (17:17 +0100)]
libxc: add xc_maximum_ram_page to wrap XENMEM_maximum_ram_page
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:16:59 +0000 (17:16 +0100)]
libxc: add xc_machphys_mfn_list to wrap XENMEM_machphys_mfn_list
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:16:13 +0000 (17:16 +0100)]
libxc: add xc_domain_maximum_gpfn to wrap XENMEM_maximum_gpfn
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:15:26 +0000 (17:15 +0100)]
libxc: add xc_domain_add_to_physmap to wrap XENMEM_add_to_physmap
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 16:14:07 +0000 (17:14 +0100)]
libxc: add xc_domain_memory_exchange_pages to wrap XENMEM_exchange
Generalised from exchange_page in xc_offline_page.c
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 15:54:42 +0000 (16:54 +0100)]
libxc: wrappers for XENMEM {increase,decrease}_reservation and populate_physmap
Currently the wrappers for these hypercalls swallow partial success
and return failure to the caller.
In order to use these functions more widely instead of open-coding
uses of XENMEM_* and xc_memory_op add variants which return the actual
hypercall result.
Therefore add the following functions:
xc_domain_increase_reservation
xc_domain_decrease_reservation
xc_domain_populate_physmap
and implement the existing semantics using these new functions as
xc_domain_increase_reservation_exact
xc_domain_decrease_reservation_exact
xc_domain_populate_physmap_exact
replacing the existing xc_domain_memory_* functions.
Use these new functions to replace all open coded uses of
XENMEM_increase_reservation, XENMEM_decrease_reservation and
XENMEM_populate_physmap.
Also rename xc_domain_memory_*_pod_target to xc_domain_*_pod_target
for consistency.
Temporarily add a compatibility macro for
xc_domain_memory_populate_physmap to allow time for qemu to catch up.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 15:53:04 +0000 (16:53 +0100)]
libxc: use correct size of struct xen_mc
We want the size of the struct not the pointer (although rounding up
to page size in lock_pages probably saves us).
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 15:52:37 +0000 (16:52 +0100)]
libxc: remove unnecessary double indirection from xc_readconsolering
The double indirection has been unnecessary since 9867:
ec61a8c25429,
there is no possibility of the buffer being reallocated now.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 15:43:58 +0000 (16:43 +0100)]
libxc: pass an xc_interface handle to page locking functions
Not actually used here but useful to confirm that a handle is passed
down to each location where it will be required once we switch to
hypercall buffers.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 18 Oct 2010 15:43:15 +0000 (16:43 +0100)]
libxc: flask: use (un)lock pages rather than open coding m(un)lock.
Allows us to do away with safe_unlock and merge into unlock_pages.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Mon, 18 Oct 2010 10:31:47 +0000 (11:31 +0100)]
x86/msi: fix inverted masks in c/s 22182:
68cc3c514a0a
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Mon, 18 Oct 2010 10:30:10 +0000 (11:30 +0100)]
x86 guest pagetable walker: check for invalid bits in pagetable
entries.
Some bits are reserved in x86 pagetable entries and must be zero; the
MMU should raise a pagefault if it sees them, with bit 3 set in the
error code. Xen's software pagetable walker hasn't been doing this,
which has been OK because no guest OSes actually have invalid bits set
except in error cases where things are already very wrong.
Xen's shadow pagetable code deliberately sets these bits as part of
the not-present-entry fast path, so if we're to support
shadow-on-shadow nested HVM, we need to start checking them.
Signed-off-by: Tim Deeegan <Tim.Deegan@citrix.com>
Gianni Tedesco [Thu, 14 Oct 2010 11:46:29 +0000 (12:46 +0100)]
pyxl: fix build of python xl binding for python < 2.5
The python C API introduced Py_ssize_t in version 2.5. Prior to this
int's were used instead. Fix the build by way of a heinous preprocessor
macro.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Ian Campbell [Wed, 13 Oct 2010 11:01:30 +0000 (12:01 +0100)]
xl: audit allocation of strings within libxl_device_*
* Remove string literals from init_*_info.
* Free any existing string values before overwriting during device
option parsing.
* Free libxl_device_console after use.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Ian Campbell [Wed, 13 Oct 2010 10:54:04 +0000 (11:54 +0100)]
libxl: remove xs_writev function
It isn't actually being used to write a vector at the only callsite
and can easily be implemented using xs_write.
Furthermore the old implementation used to leak both the key and value
strings.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Ian Campbell [Wed, 13 Oct 2010 10:45:26 +0000 (11:45 +0100)]
pygrub: support grub2 "(hdX,msdosY)" partition syntax
This appeared in Debian Squeeze at some point.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Ian Campbell [Wed, 13 Oct 2010 10:37:02 +0000 (11:37 +0100)]
xl: correct migration_domname_r
22154:
ed8019e672c6 causes migration_domname_r to be initialised as
d_config.c_info.name + "--incoming" immediately after setting
d_config.c_info.name. The intention appears to have been to set it to
common_domname + "--incoming" so do so.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Samuel Thibault [Tue, 12 Oct 2010 09:27:56 +0000 (10:27 +0100)]
MiniOS: Fix continue; in netfront receive loop
To properly ignore some requests through the use of continue;, indexes need to
be updated.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Stephan Peijnik [Mon, 11 Oct 2010 16:54:53 +0000 (17:54 +0100)]
Replace pyxml/xmlproc-based XML validator with lxml based one
Pyxml/xmlproc is being used in tools/xen/xm/xenapi_create.py but is
unmaintained for several years now. xmlproc is used only for validating
XML documents against a DTD file.
This patch replaces the pyxml/xmlproc based XML validation with code
based on lxml, which is actively maintained.
Signed-off-by: Stephan Peijnik <spe@anexia.at>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Mon, 11 Oct 2010 09:22:24 +0000 (10:22 +0100)]
tools/tests: Test 64-bit x86 emulation in test_x86_emulate.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 11 Oct 2010 08:03:18 +0000 (09:03 +0100)]
vmx: add missing VMCS definition
This patch add back some missing VMCS defintions as preparation for
nested VMX.
Signed-off-by: Qing He <qing.he@intel.com>
Signed-off-by: Eddie Dong <eddie.dong@intel.com>
Keir Fraser [Mon, 11 Oct 2010 08:02:36 +0000 (09:02 +0100)]
x86-64: workaround for BIOSes wrongly enabling LAHF_LM feature indicator
This workaround is taken from Linux, and the main motivation (besides
such workarounds indeed belonging in the hypervisor rather than each
kernel) is to suppress the warnings in the Xen log each Linux guest
would cause due to the disallowed wrmsr.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Keir Fraser [Mon, 11 Oct 2010 08:01:45 +0000 (09:01 +0100)]
x86: emulate MSR_IA32_UCODE_REV Intel access protocol
Intel requires a write of zeros (hence such writes now get silently
ignored) followed by a cpuid(1) followed by the actual read.
Includes some code redundancy elimination possible after the actual
change.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Gianni Tedesco [Fri, 8 Oct 2010 10:41:57 +0000 (11:41 +0100)]
xl: Fix build in python binding since API change in 22229:
1385b15e168f
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Gianni Tedesco [Wed, 6 Oct 2010 16:38:15 +0000 (17:38 +0100)]
xl: Implement PCI passthrough force removal
This fixes two errors with removing PCI devices from HVM domains. The
first error is that the handling of "pci-rem" device-model command is
erroneously implemented in qemu and difficult (impossible?) to get
right.
For example, during domain shutdown there can be a race where the guest
OS unloads it's drivers and perhaps even shuts down PCI subsystem before
the pci-rem command has been received by qemu. This means that no OS is
present to write to the port which causes the dm command to be
acknowledged.
We fix this by implementing a 'force removal' option to
libxl_device_pci_remove which is always set to 1 during guest shutdown.
It can be optionally enabled on the xl command line for other occasions.
The second error is that if a guest OS doesn't respond to the SCI
interrupt and therefore the pci-rem dm command, which can happen if the
guest OS has no ACPI PCI hotplug support, then device removal bails with
an error but only AFTER removing the device from xenstore. This means
that xenstore gets in to an inconsistent state where an assigned device
also appears to be assignable.
This is fixed by moving xenstore device removal to occur only after the
device has really been removed.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Wed, 6 Oct 2010 10:00:19 +0000 (11:00 +0100)]
x86 hvm: Factor out hvm_map_guest_frame_{rw,ro} from hvm_map_entry
This allows us to map pages from guest physical addresses.
This will be used with nested virtualization.
Signed-off-by: Uwe Dannowski <Uwe.Dannowski@amd.com>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Ian Campbell [Tue, 5 Oct 2010 16:51:28 +0000 (17:51 +0100)]
libxl: remove console 0 backend directory from xenstore on devices destroy
The first PV console device has an unusual frontend path for
historical reasons (/local/domain/<domid>/console rather than
/local/domain/<domid>/device/console/0).
Therefore we need to check this additional frontend path as well as
those under /local/domain/<domid>/device when tearing down all
backends or else we miss the backend for the console.
As part of this we need to ensure that the frontend directory has a
valid link to the backend, currently this link does not exist.
Fix this by adding libxl__device_frontend_path to return the correct
frontend path, accounting for the special case, and use it from
libxl__device_add_generic. Also add libxl__device_backend_path for
consistency.
This also allows console 0 setup to follow essentially the same code
path as other consoles within libxl_device_console_add, reducing the
special casing required there.
This also fixes the link from backend to frontend which until now gave
a dangling link to the normal device path instead of the exceptional
one.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>